# -*- coding: utf-8 -*-
# Copyright © 2011 by Vinay Sajip. All rights reserved. See accompanying LICENSE.txt for details.
# from logview <https://code.google.com/p/logview/>
#
# Modified by Nicholas Wilde 12/28/2012

from PyQt4.QtGui import QSplitter, QSplitterHandle
from PyQt4.QtCore import SIGNAL

class SplitterHandle(QSplitterHandle):
  def mouseDoubleClickEvent(self, event):
    super(SplitterHandle, self).mouseDoubleClickEvent(event)
    splitter = self.splitter()
    index = splitter.indexOf(self)
    splitter.emit(SIGNAL('doubleClicked(int,int)'), index, int(event.buttons()))

class Splitter(QSplitter):
  def createHandle(self):
    return SplitterHandle(self.orientation(), self)
